Optimal. Leaf size=108 \[ \frac {5 x}{2 a}+\frac {5 \cot (c+d x)}{2 a d}+\frac {i \cot ^2(c+d x)}{a d}-\frac {5 \cot ^3(c+d x)}{6 a d}+\frac {2 i \log (\sin (c+d x))}{a d}+\frac {\cot ^3(c+d x)}{2 d (a+i a \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3633, 3610,
3612, 3556} \begin {gather*} -\frac {5 \cot ^3(c+d x)}{6 a d}+\frac {i \cot ^2(c+d x)}{a d}+\frac {5 \cot (c+d x)}{2 a d}+\frac {2 i \log (\sin (c+d x))}{a d}+\frac {\cot ^3(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {5 x}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3610
Rule 3612
Rule 3633
Rubi steps
\begin {align*} \int \frac {\cot ^4(c+d x)}{a+i a \tan (c+d x)} \, dx &=\frac {\cot ^3(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {\int \cot ^4(c+d x) (-5 a+4 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=-\frac {5 \cot ^3(c+d x)}{6 a d}+\frac {\cot ^3(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {\int \cot ^3(c+d x) (4 i a+5 a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac {i \cot ^2(c+d x)}{a d}-\frac {5 \cot ^3(c+d x)}{6 a d}+\frac {\cot ^3(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {\int \cot ^2(c+d x) (5 a-4 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac {5 \cot (c+d x)}{2 a d}+\frac {i \cot ^2(c+d x)}{a d}-\frac {5 \cot ^3(c+d x)}{6 a d}+\frac {\cot ^3(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {\int \cot (c+d x) (-4 i a-5 a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac {5 x}{2 a}+\frac {5 \cot (c+d x)}{2 a d}+\frac {i \cot ^2(c+d x)}{a d}-\frac {5 \cot ^3(c+d x)}{6 a d}+\frac {\cot ^3(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {(2 i) \int \cot (c+d x) \, dx}{a}\\ &=\frac {5 x}{2 a}+\frac {5 \cot (c+d x)}{2 a d}+\frac {i \cot ^2(c+d x)}{a d}-\frac {5 \cot ^3(c+d x)}{6 a d}+\frac {2 i \log (\sin (c+d x))}{a d}+\frac {\cot ^3(c+d x)}{2 d (a+i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(365\) vs. \(2(108)=216\).
time = 3.40, size = 365, normalized size = 3.38 \begin {gather*} \frac {\csc (c) (\cos (d x)+i \sin (d x)) \left (14 \csc (c+d x)-28 \cos (c-d x) \csc (2 (c+d x))+14 i \sec (c+d x)-24 d x \sec (c+d x)+24 d x \cos ^2(c) \sec (c+d x)+3 \cos (c) \cos (2 d x) \sec (c+d x) \sin (c)+30 d x \sec (c+d x) \sin ^2(c)-3 i \cos (2 d x) \sec (c+d x) \sin ^2(c)+12 i \log \left (\sin ^2(c+d x)\right ) \sec (c+d x) \sin ^2(c)+24 \text {ArcTan}(\tan (d x)) \sec (c+d x) \sin (c) (-i \cos (c)+\sin (c))+2 \csc ^2(c+d x) \sec (c+d x) (\cos (c)+i \sin (c)) (i \cos (c)+2 \sin (c))-3 i d x \sec (c+d x) \sin (2 c)+6 \log \left (\sin ^2(c+d x)\right ) \sec (c+d x) \sin (2 c)-3 i \cos (c) \sec (c+d x) \sin (c) \sin (2 d x)-3 \sec (c+d x) \sin ^2(c) \sin (2 d x)-28 i \csc (2 (c+d x)) \sin (c-d x)+2 \csc ^3(c+d x) (-1+\cos (c-d x) \sec (c+d x)+i \sec (c+d x) \sin (c-d x))\right )}{12 a d (-i+\tan (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.28, size = 89, normalized size = 0.82
method | result | size |
derivativedivides | \(\frac {-\frac {9 i \ln \left (\tan \left (d x +c \right )-i\right )}{4}+\frac {1}{2 \tan \left (d x +c \right )-2 i}-\frac {1}{3 \tan \left (d x +c \right )^{3}}+\frac {i}{2 \tan \left (d x +c \right )^{2}}+2 i \ln \left (\tan \left (d x +c \right )\right )+\frac {2}{\tan \left (d x +c \right )}+\frac {i \ln \left (\tan \left (d x +c \right )+i\right )}{4}}{d a}\) | \(89\) |
default | \(\frac {-\frac {9 i \ln \left (\tan \left (d x +c \right )-i\right )}{4}+\frac {1}{2 \tan \left (d x +c \right )-2 i}-\frac {1}{3 \tan \left (d x +c \right )^{3}}+\frac {i}{2 \tan \left (d x +c \right )^{2}}+2 i \ln \left (\tan \left (d x +c \right )\right )+\frac {2}{\tan \left (d x +c \right )}+\frac {i \ln \left (\tan \left (d x +c \right )+i\right )}{4}}{d a}\) | \(89\) |
risch | \(\frac {9 x}{2 a}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )}}{4 d a}+\frac {4 c}{d a}+\frac {2 i \left (6 \,{\mathrm e}^{4 i \left (d x +c \right )}-9 \,{\mathrm e}^{2 i \left (d x +c \right )}+7\right )}{3 d a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {2 i \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d a}\) | \(102\) |
norman | \(\frac {\frac {i \left (\tan ^{3}\left (d x +c \right )\right )}{d a}-\frac {1}{3 d a}+\frac {5 \left (\tan ^{4}\left (d x +c \right )\right )}{2 d a}+\frac {5 x \left (\tan ^{3}\left (d x +c \right )\right )}{2 a}+\frac {5 x \left (\tan ^{5}\left (d x +c \right )\right )}{2 a}+\frac {5 \left (\tan ^{2}\left (d x +c \right )\right )}{3 d a}+\frac {i \tan \left (d x +c \right )}{2 d a}}{\tan \left (d x +c \right )^{3} \left (1+\tan ^{2}\left (d x +c \right )\right )}+\frac {2 i \ln \left (\tan \left (d x +c \right )\right )}{d a}-\frac {i \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d a}\) | \(160\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 181, normalized size = 1.68 \begin {gather*} \frac {54 \, d x e^{\left (8 i \, d x + 8 i \, c\right )} - 3 \, {\left (54 \, d x - 17 i\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + 81 \, {\left (2 \, d x - i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - {\left (54 \, d x - 65 i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 24 \, {\left (-i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 3 i \, e^{\left (6 i \, d x + 6 i \, c\right )} - 3 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + i \, e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) - 3 i}{12 \, {\left (a d e^{\left (8 i \, d x + 8 i \, c\right )} - 3 \, a d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, a d e^{\left (4 i \, d x + 4 i \, c\right )} - a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.27, size = 196, normalized size = 1.81 \begin {gather*} \frac {12 i e^{4 i c} e^{4 i d x} - 18 i e^{2 i c} e^{2 i d x} + 14 i}{3 a d e^{6 i c} e^{6 i d x} - 9 a d e^{4 i c} e^{4 i d x} + 9 a d e^{2 i c} e^{2 i d x} - 3 a d} + \begin {cases} \frac {i e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text {for}\: a d e^{2 i c} \neq 0 \\x \left (\frac {\left (9 e^{2 i c} + 1\right ) e^{- 2 i c}}{2 a} - \frac {9}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {9 x}{2 a} + \frac {2 i \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.79, size = 116, normalized size = 1.07 \begin {gather*} -\frac {\frac {27 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} - \frac {3 i \, \log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a} - \frac {24 i \, \log \left (\tan \left (d x + c\right )\right )}{a} + \frac {3 \, {\left (-9 i \, \tan \left (d x + c\right ) - 11\right )}}{a {\left (\tan \left (d x + c\right ) - i\right )}} + \frac {2 i \, {\left (22 \, \tan \left (d x + c\right )^{3} + 12 i \, \tan \left (d x + c\right )^{2} - 3 \, \tan \left (d x + c\right ) - 2 i\right )}}{a \tan \left (d x + c\right )^{3}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.09, size = 126, normalized size = 1.17 \begin {gather*} -\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,9{}\mathrm {i}}{4\,a\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4\,a\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,2{}\mathrm {i}}{a\,d}+\frac {\frac {\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}{6\,a}-\frac {1}{3\,a}+\frac {3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2\,a}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^3\,5{}\mathrm {i}}{2\,a}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^4\,1{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^3\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________